
<template>
  <div>
    <SearchForm
        @search="onSearch"
        @reset="onReset"
        :search-list="searchList" :search-params="searchParams">
    </SearchForm>
    <div class="table-layout">
      <el-card shadow="never">
        <div class="table-box">
          <el-table
              size="large"
              stripe
              border
              v-loading="loading"
              max-height="500px"
              :data="tableData"
              row-key="id"
              element-loading-spinner="el-icon-loading"
              element-loading-background="rgba(255, 255, 255, 0.8)"
              @selection-change="onSelect"
            >
            <el-table-column label="创建时间" prop="create_time">
            </el-table-column>
            <el-table-column label="query" prop="query" min-width="160">
            </el-table-column>
            <el-table-column label="answer" prop="answer" min-width="400">
            </el-table-column>
            <el-table-column label="productName" prop="product_name">
            </el-table-column>

            <el-table-column label="productUrl" prop="url" show-overflow-tooltip>
              <template #default="scope">
                <el-link :href="scope.row.url" target="_blank">{{scope.row.url}}</el-link>
              </template>
            </el-table-column>
            <el-table-column label="openCount" prop="open_count">
            </el-table-column>
          </el-table>
        </div>

        <div class="page-box">
          <el-pagination
              background
              :current-page="pageNo"
              :page-sizes="pageSizes"
              :page-size="pageSize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="totalSize"
              @size-change="changePageSize"
              @current-change="changePageNo"
          />
        </div>
      </el-card>
    </div>

  </div>
</template>
<script>

import crud from "@/mixins/crud";
import { http } from "@/api";
export default {
  name: "index",
  components: {
  },
  mixins: [crud],
  data() {
    return {
      request: http.messageProduct,
      searchList: [
        {
          label: '开始日期',
          key: 'start_date',
          name: 'date',
          dateType: 'date',
          clearable: true,
          width: '200px'
        },
        {
          label: '结束日期',
          key: 'end_date',
          name: 'date',
          dateType: 'date',
          clearable: true,
          width: '200px'
        },
      ],
      searchParams: {
        start_date: '',
        end_date: ''
      },
      tableData: []
    }
  },
  methods: {}
}
</script>

<style scoped lang="scss">

</style>
